• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

PHP/HTML tables alignment question

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
898
Solutions
21
Reaction score
429
Location
Santiago - Chile
Hi! I think this is a very simple thing, but I would like to learn a little with this. I wish to align my characterprofile table to the left, since it is cutting in the middle, I would like to cut exactly where the text categories ends (if the answer can contain more table examples for learning purpose would be great). The image will explain better what I need (using Znote AAC btw):

table_align.png

I don't know where to find characterProfileTable properties since it has none metions on .css files.

Here's my characterprofile.php:

Thanks in advance,
Regards!
 
Solution
The td's have a colspan, you could set the first td colspan to 1, and the following colspan of the data to 3 which will give it a 25/75% ratio.

You can also use table-layout:auto; which should fit to the content as you required.

This is why I have always hated HTML tables. Look into flexbox or even manual div manipulation, they are much better alternatives.
OP
OP
ralke

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
898
Solutions
21
Reaction score
429
Location
Santiago - Chile
Inspect that cell through browser, check its CSS and then you'll find out :p
Thanks a lot for responding ^^
I have said in the post, searched on style.css that is the main .css file and have no clue which parameter is involved
Ralke said:
I don't know where to find characterProfileTable properties since it has none metions on .css files.
Well player tables is basically the same that the Death List table, but, the Death List behaves how I want, what i'm missing? (I think is a simple thing but I just don't see it)

inspect_1.png
inspect_2.png

Regards!
 

Boy67

Well-Known Member
Joined
Jul 4, 2007
Messages
246
Solutions
11
Reaction score
96
Location
England
The td's have a colspan, you could set the first td colspan to 1, and the following colspan of the data to 3 which will give it a 25/75% ratio.

You can also use table-layout:auto; which should fit to the content as you required.

This is why I have always hated HTML tables. Look into flexbox or even manual div manipulation, they are much better alternatives.
 
Solution
OP
OP
ralke

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
898
Solutions
21
Reaction score
429
Location
Santiago - Chile
The td's have a colspan, you could set the first td colspan to 1, and the following colspan of the data to 3 which will give it a 25/75% ratio.

You can also use table-layout:auto; which should fit to the content as you required.
Thanks! Worked perfectly. Not sure if the design looks really good but I learned ^^
characterprofile.png

This is why I have always hated HTML tables. Look into flexbox or even manual div manipulation, they are much better alternatives.
I agree, bad tables can be a total mess o_O I will search for flexbox and div manipulation, thanks for the tip!
 
Top