TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   Percentage problem on width of table columns (http://forums.techarena.in/software-development/1230405.htm)

Zeverto 12-08-2009 11:31 AM

Percentage problem on width of table columns
 
The table column on my page is set to 15% and the width on the 3 middle columns are 39% each. I don't want to be over 350 pixels in width on table column. It should display smaller size on page.How can I prevent this or overcome this?

Zecho 12-08-2009 11:34 AM

Re: Percentage problem on width of table columns
 
The table displayed in page is used for page layout?Table-based layouts require a lot more HTML markup than do standards-based layouts. You can set the CSS property "max-width" :
Code:

<table style="max-width:350px;">

Walby 12-08-2009 11:39 AM

Re: Percentage problem on width of table columns
 
WIDTH = "width expression" Using the width attribute, you can explicitly set the width of your table.
Code:

<TABLE BORDER>
<TR> <TD WIDTH="90%">f</TD> <TD WIDTH="30%">a</TD> </TR>
<TR> <TD>b</TD> <TD>e</TD> </TR>
<TR> <TD>c</TD> <TD>d</TD> </TR>
</TABLE>

When defining a width in pixels, keep in mind the available space on your web page with respect to the screen resolution. This code will make gp means set width of 90 in first row.

Aberto 12-08-2009 11:42 AM

Re: Percentage problem on width of table columns
 
A table will not display until ALL of the HTML it has loaded, when set width of table make sure that WIDTH is set as the width of the table cell.When using percentages as values for the width attribute, web browsers will automatically resize your table according to available screen space defined in the screen resolution.


All times are GMT +5.5. The time now is 02:38 AM.