Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

Table cell text going beyond its defined width
(1 viewing) (1) Guest
All your queries regarding CSS will be solved in this forum
  • Page:
  • 1
TOPIC:

Table cell text going beyond its defined width

Table cell text going beyond its defined width 9 months ago #799

  • tanvi
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
I made a table with 4 columns.

Code:

HTML Code:

<table>
<tbody>
<tr>
<td>Testing for long word.Testing for long word.Testing for long word.Testing for long word.Testing for long word.</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
</tbody>
</table>

Css Code:
<s-tyle type="text/css">
table{width:100%;}
td{width:25%;}
</style>

Table looks perfect but when I have a long word with no spaces in the cell, the column goes beyond its 25% that I defined.
Last Edit: 9 months ago by tanvi.

Re: Table cell text going beyond its defined width 9 months ago #800

  • shama
  • OFFLINE
  • Senior Boarder
  • Posts: 63
  • Karma: 0
Code:

<s-tyle type="text/css">
table{width:100%;table-layout:fixed;border-collapse:collapse}
td{width:25%;overflow:hidden;}
</style>

this works nicely...
  • Page:
  • 1
Time to create page: 1.49 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download