Page 1 of 1
how can i make each teble cell have a fixed size?
Posted: Sat Jun 21, 2003 1:25 pm
by Nik
Code: Select all
while ( $row = $st->fetchrow_hashref )
{
print table( {-border=>5, -width=>"80%", -align=>"center", -style=>"Color: LightGreen; font-size: 20", -background=>"../images/blue.jpg"},
Tr( td( {-align=>'center'}, font( {-size=>4, -color=>'Cyan'}, $row->{onoma} ) ),
td( {-align=>'center'}, font( {-size=>4, -color=>'Lime'}, $row->{sxolio} ) ),
td( {-align=>'center'}, font( {-size=>4, -color=>'Yellow'}, $row->{xronos} ) ) ),
Tr( td( {-colspan=>2, -align=>'center'}, font( {-size=>4, -color=>'Pink'}, $row->{host} ) ),
td( { -align=>'center'}, font( {-size=>4, -color=>'Orange'}, $row->{email} ) ) ) ),
br(), br();
}
i tied to use {width=>'15%'} indise td but didnt work?
anyone have an idea?
Posted: Sat Jun 21, 2003 1:36 pm
by patrikG
If you want fixed cell-size, use absolute values (not relative, i.e. %) in the height- and width-properties of your cell.
I don't know which class you are using to output that html-table, but try inserting "width='50' height='10'".
Posted: Sat Jun 21, 2003 1:41 pm
by Nik
thanks man! it worked ok!
Posted: Sat Jun 21, 2003 1:44 pm
by Nik
but why must i use absolute values and not relative??
Posted: Sat Jun 21, 2003 1:47 pm
by Nik
actually both ways looks thesame
cells are not fixed!
fixed
Posted: Sat Jun 21, 2003 5:36 pm
by phpScott
you must use fixed width and hieght if you always want to have a cell that is 50 pixels by 50 pixels other wise using % 's will have the cells automatically adjust to the that they are are allocated. This could depened on table size or screen size of the person viewing your site.
If what patrikG suggested is not working you might have to remove the width attribure in your table declaration
Code: Select all
<?php
print table( {-border=>5, -width=>"80%", -align=>"center", -style=>"Color: LightGreen; font-size: 20", -background=>"../images/blue.jpg"},
?>
as that is allcotion the space for the table size and your td tags will have to use at that much space as you can't have extra table space that is not allocated
phpScott