/    Sign up×
Community /Pin to ProfileBookmark

Fixed table cell height and width

Hello
I have a table and I set its cells width and height by the following CSS,
td {
height: 120px;
width: 200px;
}
Suppose a big image is placed inside a cell of this table or huge amount of text. I want to keep the cell dimenstions fixed without any change. How can I get this?

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@deep_dhyaniFeb 21.2006 — set the width & height in "%" of the attribute i.e

[code]
<div style="width:200px;height:300;">
<img src="img.gif" width="100%" height="100%">
</div>
[code]
Copy linkTweet thisAlerts:
@pcthugFeb 21.2006 — or[CODE]<div style="width:200px;height:300;overflow:hidden;">
<img src="img.gif" width="300[B]px[/B]" height="400[B]px[/B]">
</div>[/CODE]
Specify the width and height attributes with a fixed unit of measurement, preferably pixels

Please note any excess will be hidden, adjust the overflow property to auto if you wish to have scrolling
Copy linkTweet thisAlerts:
@Gaurav_KhannaFeb 22.2006 — <html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

<div style="height:300px; width:200px; overflow:scroll">

<table>

<tr>

<td>

<img src="j0399394.jpg">


</td>

</tr>

</table>

</div>

</body>

</html>

replace overflow: hidden in case if u don't want scroll.
Copy linkTweet thisAlerts:
@said_foxauthorFeb 23.2006 — I can not use pixel. I should use mm because the document will be printed and I want to determine its actual dimensions on the paper. I am not concerned with the excess data that will not be displayed. The important thing for me is keeping the cell dimention fixed, specially, when the data is text.
Copy linkTweet thisAlerts:
@Gaurav_KhannaFeb 23.2006 — ok then convert pixels into mm simple.
Copy linkTweet thisAlerts:
@said_foxauthorFeb 23.2006 — ok then convert pixels into mm simple.[/QUOTE]
You may agree with me that insert the table itself inside a DIV tag may be has no effect to keep the table's cell height fixed. I want to know the replacement of the following "????" to make the cell height fixed:

<td style="????">

That's I just need.
×

Success!

Help @said_fox spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...