右对齐未知表列 [英] right align unknown table column

查看:57
本文介绍了右对齐未知表列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的html页面中,我想创建一个表格。我不知道有多少列。但我知道它的一些列和第三列包含数字,我需要正确对齐它们。我该怎么办?

In my html page I want create a table. I don't know how many columns are there. But I know that some of its columns and 3rd last column contain numerals and I need to right align them. How can I do it?

推荐答案

您好,



根据您的要求,您可以在不同的地方进行方式。



我要告诉你两种方式



1.设置班级名称/风格td你必须设置正确的对齐。
Hi ,

For your requirement you can do it in different ways .

I'm gonna tell you two ways

1.setting class name/style to td whatever you have to set right align.


('tr')。append('
first colimen
第二列
< tr>
1
');

2.使用伪代码你可以设置右对齐。 css文件

(你必须提到表名类)



在CSS文件中

.mytable tr td:last

{

text-align:right;

}







所有最好的
('tr').append('
first colimen
second column
1
');
2.using pseudo code you can set right align in .css file
( you have to mention class name to table )

In CSS file
.mytable tr td:last
{
text-align:right;
}



All the Best


我不明白你的问题ñ。你想在html页面中对齐表格在你的表格标签上试试align =right下面给出一个小例子

i didn't understand your question. do you want align table in html page try align="right" on your table tag a small example given below
<table align="right">
<tr>
<td>anything1</td>
<td>anything2</td>
</tr>
</table>


这篇关于右对齐未知表列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆