如何访问表的特定TD? [英] How to access a specific td of a table?
本文介绍了如何访问表的特定TD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
假设我在一行中有一个包含5列的表格,我想知道如何在CSS中访问特定的td来设置其宽度?例如,对于第一个td width ="10px",第二个td width ="15px",依此类推.我应该如何在CSS中执行此操作?谢谢大家.
Hello Guys,
Let''s say that i have a table with 5 column''s in a single row, i would like to know how to access the specific td in css to set it''s width? Like for example for the 1st td width = "10px", 2nd td width = "15px" and so on. How am i supposed to do this in css? Thanks guys.
推荐答案
为您html
say
defineid
to eachtd
in yourhtml
say
<style type="text/css">
#tdfirst
{
width:50px;
}
#tdsecond
{
width:50px;
}
</style>
<table><tr><td id="tdfirst"></td><td id="tdsecond"></td></tr></table>
如果它是您的答案,则将其标记为解决方案
谢谢
mark it solution if it is your answer
Thanks
这篇关于如何访问表的特定TD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文