table中thead固定一直在最上面

<link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.5" rel="stylesheet">

<link href="css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

<link href="css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">

<link href="css/animate.min.css" rel="stylesheet">

<link href="css/style.min.css?v=4.0.0" rel="stylesheet">

<div class="fixed-table-container" style="height: 341px; padding-bottom: 36px;"><div class="fixed-table-header" style="margin-right: 6px;"><table class="table table-hover" style="width: 2828px;"><thead><tr><th style="" data-field="字段0" tabindex="0"><div class="th-inner ">单元0</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段1" tabindex="0"><div class="th-inner ">单元1</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段2" tabindex="0"><div class="th-inner ">单元2</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段3" tabindex="0"><div class="th-inner ">单元3</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段4" tabindex="0"><div class="th-inner ">单元4</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段5" tabindex="0"><div class="th-inner ">单元5</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段6" tabindex="0"><div class="th-inner ">单元6</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段7" tabindex="0"><div class="th-inner ">单元7</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段8" tabindex="0"><div class="th-inner ">单元8</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段9" tabindex="0"><div class="th-inner ">单元9</div><div class="fht-cell" style="width: 50px;"></div></th><th style="" data-field="字段10" tabindex="0"><div class="th-inner ">单元10</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段11" tabindex="0"><div class="th-inner ">单元11</div><div class="fht-cell" style="width: 56px;"></div></th><th style="" data-field="字段12" tabindex="0"><div class="th-inner ">单元12</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段13" tabindex="0"><div class="th-inner ">单元13</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段14" tabindex="0"><div class="th-inner ">单元14</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段15" tabindex="0"><div class="th-inner ">单元15</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段16" tabindex="0"><div class="th-inner ">单元16</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段17" tabindex="0"><div class="th-inner ">单元17</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段18" tabindex="0"><div class="th-inner ">单元18</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段19" tabindex="0"><div class="th-inner ">单元19</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段20" tabindex="0"><div class="th-inner ">单元20</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段21" tabindex="0"><div class="th-inner ">单元21</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段22" tabindex="0"><div class="th-inner ">单元22</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段23" tabindex="0"><div class="th-inner ">单元23</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段24" tabindex="0"><div class="th-inner ">单元24</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段25" tabindex="0"><div class="th-inner ">单元25</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段26" tabindex="0"><div class="th-inner ">单元26</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段27" tabindex="0"><div class="th-inner ">单元27</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段28" tabindex="0"><div class="th-inner ">单元28</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段29" tabindex="0"><div class="th-inner ">单元29</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段30" tabindex="0"><div class="th-inner ">单元30</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段31" tabindex="0"><div class="th-inner ">单元31</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段32" tabindex="0"><div class="th-inner ">单元32</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段33" tabindex="0"><div class="th-inner ">单元33</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段34" tabindex="0"><div class="th-inner ">单元34</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段35" tabindex="0"><div class="th-inner ">单元35</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段36" tabindex="0"><div class="th-inner ">单元36</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段37" tabindex="0"><div class="th-inner ">单元37</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段38" tabindex="0"><div class="th-inner ">单元38</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段39" tabindex="0"><div class="th-inner ">单元39</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段40" tabindex="0"><div class="th-inner ">单元40</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段41" tabindex="0"><div class="th-inner ">单元41</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段42" tabindex="0"><div class="th-inner ">单元42</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段43" tabindex="0"><div class="th-inner ">单元43</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段44" tabindex="0"><div class="th-inner ">单元44</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段45" tabindex="0"><div class="th-inner ">单元45</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段46" tabindex="0"><div class="th-inner ">单元46</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段47" tabindex="0"><div class="th-inner ">单元47</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段48" tabindex="0"><div class="th-inner ">单元48</div><div class="fht-cell" style="width: 57px;"></div></th><th style="" data-field="字段49" tabindex="0"><div class="th-inner ">单元49</div><div class="fht-cell" style="width: 57px;"></div></th></tr></thead></table></div><div class="fixed-table-body"><table id="exampleTableLargeColumns" data-show-columns="true" data-height="400" data-mobile-responsive="true" class="table table-hover" style="margin-top: -36px;"><thead><tr><th style="" data-field="字段0" tabindex="0"><div class="th-inner ">单元0</div><div class="fht-cell"></div></th><th style="" data-field="字段1" tabindex="0"><div class="th-inner ">单元1</div><div class="fht-cell"></div></th><th style="" data-field="字段2" tabindex="0"><div class="th-inner ">单元2</div><div class="fht-cell"></div></th><th style="" data-field="字段3" tabindex="0"><div class="th-inner ">单元3</div><div class="fht-cell"></div></th><th style="" data-field="字段4" tabindex="0"><div class="th-inner ">单元4</div><div class="fht-cell"></div></th><th style="" data-field="字段5" tabindex="0"><div class="th-inner ">单元5</div><div class="fht-cell"></div></th><th style="" data-field="字段6" tabindex="0"><div class="th-inner ">单元6</div><div class="fht-cell"></div></th><th style="" data-field="字段7" tabindex="0"><div class="th-inner ">单元7</div><div class="fht-cell"></div></th><th style="" data-field="字段8" tabindex="0"><div class="th-inner ">单元8</div><div class="fht-cell"></div></th><th style="" data-field="字段9" tabindex="0"><div class="th-inner ">单元9</div><div class="fht-cell"></div></th><th style="" data-field="字段10" tabindex="0"><div class="th-inner ">单元10</div><div class="fht-cell"></div></th><th style="" data-field="字段11" tabindex="0"><div class="th-inner ">单元11</div><div class="fht-cell"></div></th><th style="" data-field="字段12" tabindex="0"><div class="th-inner ">单元12</div><div class="fht-cell"></div></th><th style="" data-field="字段13" tabindex="0"><div class="th-inner ">单元13</div><div class="fht-cell"></div></th><th style="" data-field="字段14" tabindex="0"><div class="th-inner ">单元14</div><div class="fht-cell"></div></th><th style="" data-field="字段15" tabindex="0"><div class="th-inner ">单元15</div><div class="fht-cell"></div></th><th style="" data-field="字段16" tabindex="0"><div class="th-inner ">单元16</div><div class="fht-cell"></div></th><th style="" data-field="字段17" tabindex="0"><div class="th-inner ">单元17</div><div class="fht-cell"></div></th><th style="" data-field="字段18" tabindex="0"><div class="th-inner ">单元18</div><div class="fht-cell"></div></th><th style="" data-field="字段19" tabindex="0"><div class="th-inner ">单元19</div><div class="fht-cell"></div></th><th style="" data-field="字段20" tabindex="0"><div class="th-inner ">单元20</div><div class="fht-cell"></div></th><th style="" data-field="字段21" tabindex="0"><div class="th-inner ">单元21</div><div class="fht-cell"></div></th><th style="" data-field="字段22" tabindex="0"><div class="th-inner ">单元22</div><div class="fht-cell"></div></th><th style="" data-field="字段23" tabindex="0"><div class="th-inner ">单元23</div><div class="fht-cell"></div></th><th style="" data-field="字段24" tabindex="0"><div class="th-inner ">单元24</div><div class="fht-cell"></div></th><th style="" data-field="字段25" tabindex="0"><div class="th-inner ">单元25</div><div class="fht-cell"></div></th><th style="" data-field="字段26" tabindex="0"><div class="th-inner ">单元26</div><div class="fht-cell"></div></th><th style="" data-field="字段27" tabindex="0"><div class="th-inner ">单元27</div><div class="fht-cell"></div></th><th style="" data-field="字段28" tabindex="0"><div class="th-inner ">单元28</div><div class="fht-cell"></div></th><th style="" data-field="字段29" tabindex="0"><div class="th-inner ">单元29</div><div class="fht-cell"></div></th><th style="" data-field="字段30" tabindex="0"><div class="th-inner ">单元30</div><div class="fht-cell"></div></th><th style="" data-field="字段31" tabindex="0"><div class="th-inner ">单元31</div><div class="fht-cell"></div></th><th style="" data-field="字段32" tabindex="0"><div class="th-inner ">单元32</div><div class="fht-cell"></div></th><th style="" data-field="字段33" tabindex="0"><div class="th-inner ">单元33</div><div class="fht-cell"></div></th><th style="" data-field="字段34" tabindex="0"><div class="th-inner ">单元34</div><div class="fht-cell"></div></th><th style="" data-field="字段35" tabindex="0"><div class="th-inner ">单元35</div><div class="fht-cell"></div></th><th style="" data-field="字段36" tabindex="0"><div class="th-inner ">单元36</div><div class="fht-cell"></div></th><th style="" data-field="字段37" tabindex="0"><div class="th-inner ">单元37</div><div class="fht-cell"></div></th><th style="" data-field="字段38" tabindex="0"><div class="th-inner ">单元38</div><div class="fht-cell"></div></th><th style="" data-field="字段39" tabindex="0"><div class="th-inner ">单元39</div><div class="fht-cell"></div></th><th style="" data-field="字段40" tabindex="0"><div class="th-inner ">单元40</div><div class="fht-cell"></div></th><th style="" data-field="字段41" tabindex="0"><div class="th-inner ">单元41</div><div class="fht-cell"></div></th><th style="" data-field="字段42" tabindex="0"><div class="th-inner ">单元42</div><div class="fht-cell"></div></th><th style="" data-field="字段43" tabindex="0"><div class="th-inner ">单元43</div><div class="fht-cell"></div></th><th style="" data-field="字段44" tabindex="0"><div class="th-inner ">单元44</div><div class="fht-cell"></div></th><th style="" data-field="字段45" tabindex="0"><div class="th-inner ">单元45</div><div class="fht-cell"></div></th><th style="" data-field="字段46" tabindex="0"><div class="th-inner ">单元46</div><div class="fht-cell"></div></th><th style="" data-field="字段47" tabindex="0"><div class="th-inner ">单元47</div><div class="fht-cell"></div></th><th style="" data-field="字段48" tabindex="0"><div class="th-inner ">单元48</div><div class="fht-cell"></div></th><th style="" data-field="字段49" tabindex="0"><div class="th-inner ">单元49</div><div class="fht-cell"></div></th></tr></thead><tbody><tr data-index="0"><td style="">Row-0-0</td><td style="">Row-0-1</td><td style="">Row-0-2</td><td style="">Row-0-3</td><td style="">Row-0-4</td><td style="">Row-0-5</td><td style="">Row-0-6</td><td style="">Row-0-7</td><td style="">Row-0-8</td><td style="">Row-0-9</td><td style="">Row-0-10</td><td style="">Row-0-11</td><td style="">Row-0-12</td><td style="">Row-0-13</td><td style="">Row-0-14</td><td style="">Row-0-15</td><td style="">Row-0-16</td><td style="">Row-0-17</td><td style="">Row-0-18</td><td style="">Row-0-19</td><td style="">Row-0-20</td><td style="">Row-0-21</td><td style="">Row-0-22</td><td style="">Row-0-23</td><td style="">Row-0-24</td><td style="">Row-0-25</td><td style="">Row-0-26</td><td style="">Row-0-27</td><td style="">Row-0-28</td><td style="">Row-0-29</td><td style="">Row-0-30</td><td style="">Row-0-31</td><td style="">Row-0-32</td><td style="">Row-0-33</td><td style="">Row-0-34</td><td style="">Row-0-35</td><td style="">Row-0-36</td><td style="">Row-0-37</td><td style="">Row-0-38</td><td style="">Row-0-39</td><td style="">Row-0-40</td><td style="">Row-0-41</td><td style="">Row-0-42</td><td style="">Row-0-43</td><td style="">Row-0-44</td><td style="">Row-0-45</td><td style="">Row-0-46</td><td style="">Row-0-47</td><td style="">Row-0-48</td><td style="">Row-0-49</td></tr><tr data-index="1"><td style="">Row-1-0</td><td style="">Row-1-1</td><td style="">Row-1-2</td><td style="">Row-1-3</td><td style="">Row-1-4</td><td style="">Row-1-5</td><td style="">Row-1-6</td><td style="">Row-1-7</td><td style="">Row-1-8</td><td style="">Row-1-9</td><td style="">Row-1-10</td><td style="">Row-1-11</td><td style="">Row-1-12</td><td style="">Row-1-13</td><td style="">Row-1-14</td><td style="">Row-1-15</td><td style="">Row-1-16</td><td style="">Row-1-17</td><td style="">Row-1-18</td><td style="">Row-1-19</td><td style="">Row-1-20</td><td style="">Row-1-21</td><td style="">Row-1-22</td><td style="">Row-1-23</td><td style="">Row-1-24</td><td style="">Row-1-25</td><td style="">Row-1-26</td><td style="">Row-1-27</td><td style="">Row-1-28</td><td style="">Row-1-29</td><td style="">Row-1-30</td><td style="">Row-1-31</td><td style="">Row-1-32</td><td style="">Row-1-33</td><td style="">Row-1-34</td><td style="">Row-1-35</td><td style="">Row-1-36</td><td style="">Row-1-37</td><td style="">Row-1-38</td><td style="">Row-1-39</td><td style="">Row-1-40</td><td style="">Row-1-41</td><td style="">Row-1-42</td><td style="">Row-1-43</td><td style="">Row-1-44</td><td style="">Row-1-45</td><td style="">Row-1-46</td><td style="">Row-1-47</td><td style="">Row-1-48</td><td style="">Row-1-49</td></tr><tr data-index="2"><td style="">Row-2-0</td><td style="">Row-2-1</td><td style="">Row-2-2</td><td style="">Row-2-3</td><td style="">Row-2-4</td><td style="">Row-2-5</td><td style="">Row-2-6</td><td style="">Row-2-7</td><td style="">Row-2-8</td><td style="">Row-2-9</td><td style="">Row-2-10</td><td style="">Row-2-11</td><td style="">Row-2-12</td><td style="">Row-2-13</td><td style="">Row-2-14</td><td style="">Row-2-15</td><td style="">Row-2-16</td><td style="">Row-2-17</td><td style="">Row-2-18</td><td style="">Row-2-19</td><td style="">Row-2-20</td><td style="">Row-2-21</td><td style="">Row-2-22</td><td style="">Row-2-23</td><td style="">Row-2-24</td><td style="">Row-2-25</td><td style="">Row-2-26</td><td style="">Row-2-27</td><td style="">Row-2-28</td><td style="">Row-2-29</td><td style="">Row-2-30</td><td style="">Row-2-31</td><td style="">Row-2-32</td><td style="">Row-2-33</td><td style="">Row-2-34</td><td style="">Row-2-35</td><td style="">Row-2-36</td><td style="">Row-2-37</td><td style="">Row-2-38</td><td style="">Row-2-39</td><td style="">Row-2-40</td><td style="">Row-2-41</td><td style="">Row-2-42</td><td style="">Row-2-43</td><td style="">Row-2-44</td><td style="">Row-2-45</td><td style="">Row-2-46</td><td style="">Row-2-47</td><td style="">Row-2-48</td><td style="">Row-2-49</td></tr><tr data-index="3"><td style="">Row-3-0</td><td style="">Row-3-1</td><td style="">Row-3-2</td><td style="">Row-3-3</td><td style="">Row-3-4</td><td style="">Row-3-5</td><td style="">Row-3-6</td><td style="">Row-3-7</td><td style="">Row-3-8</td><td style="">Row-3-9</td><td style="">Row-3-10</td><td style="">Row-3-11</td><td style="">Row-3-12</td><td style="">Row-3-13</td><td style="">Row-3-14</td><td style="">Row-3-15</td><td style="">Row-3-16</td><td style="">Row-3-17</td><td style="">Row-3-18</td><td style="">Row-3-19</td><td style="">Row-3-20</td><td style="">Row-3-21</td><td style="">Row-3-22</td><td style="">Row-3-23</td><td style="">Row-3-24</td><td style="">Row-3-25</td><td style="">Row-3-26</td><td style="">Row-3-27</td><td style="">Row-3-28</td><td style="">Row-3-29</td><td style="">Row-3-30</td><td style="">Row-3-31</td><td style="">Row-3-32</td><td style="">Row-3-33</td><td style="">Row-3-34</td><td style="">Row-3-35</td><td style="">Row-3-36</td><td style="">Row-3-37</td><td style="">Row-3-38</td><td style="">Row-3-39</td><td style="">Row-3-40</td><td style="">Row-3-41</td><td style="">Row-3-42</td><td style="">Row-3-43</td><td style="">Row-3-44</td><td style="">Row-3-45</td><td style="">Row-3-46</td><td style="">Row-3-47</td><td style="">Row-3-48</td><td style="">Row-3-49</td></tr><tr data-index="4"><td style="">Row-4-0</td><td style="">Row-4-1</td><td style="">Row-4-2</td><td style="">Row-4-3</td><td style="">Row-4-4</td><td style="">Row-4-5</td><td style="">Row-4-6</td><td style="">Row-4-7</td><td style="">Row-4-8</td><td style="">Row-4-9</td><td style="">Row-4-10</td><td style="">Row-4-11</td><td style="">Row-4-12</td><td style="">Row-4-13</td><td style="">Row-4-14</td><td style="">Row-4-15</td><td style="">Row-4-16</td><td style="">Row-4-17</td><td style="">Row-4-18</td><td style="">Row-4-19</td><td style="">Row-4-20</td><td style="">Row-4-21</td><td style="">Row-4-22</td><td style="">Row-4-23</td><td style="">Row-4-24</td><td style="">Row-4-25</td><td style="">Row-4-26</td><td style="">Row-4-27</td><td style="">Row-4-28</td><td style="">Row-4-29</td><td style="">Row-4-30</td><td style="">Row-4-31</td><td style="">Row-4-32</td><td style="">Row-4-33</td><td style="">Row-4-34</td><td style="">Row-4-35</td><td style="">Row-4-36</td><td style="">Row-4-37</td><td style="">Row-4-38</td><td style="">Row-4-39</td><td style="">Row-4-40</td><td style="">Row-4-41</td><td style="">Row-4-42</td><td style="">Row-4-43</td><td style="">Row-4-44</td><td style="">Row-4-45</td><td style="">Row-4-46</td><td style="">Row-4-47</td><td style="">Row-4-48</td><td style="">Row-4-49</td></tr></tbody></table></div></div>

<script src="js/jquery.min.js?v=2.1.4"></script>

<script src="js/bootstrap.min.js?v=3.3.5"></script>

<script src="js/content.min.js?v=1.0.0"></script>

<script src="js/plugins/bootstrap-table/bootstrap-table.min.js"></script>

<script src="js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></scrip

<script src="js/demo/bootstrap-table-demo.min.js"></script>

最后效果:

原文地址:https://www.cnblogs.com/xiaozhouyuxiaohou/p/9125541.html

时间: 2024-10-10 07:16:52

table中thead固定一直在最上面的相关文章

table中thead保持不动,tbody滚动(2)

如果table中的th和td都没有合并列,可以不设th和td宽度 #tblDataList{ height:600px;}#tblDataList thead { display:block;} #tblDataList tbody { display:block; height:600px; overflow-y:scroll;} #tblDataList thead tr { display:table; width:100%; table-layout:fixed;}#tblDataLis

table 中 thead tbody tfoot 加载顺序问题

这几个标记主要是用于提高table标签的加载以及显示的,说白了,就是分布加载.在传统的浏览器,在加载 时,是当所有的标签中元素都被下载后才会显示,当然这样的用户体验是不好的.再加入了这几个t打头的标签后,table就会分布的加载table中的元素,顺序依据写在table中的标签顺序进行. 为了让大表格(table)在下载的时候可以分段的显示,就是说在浏览器解析HTML时,table是作为一个整体解释的,使用TBODY可以优化显示.如果表格很长,用tbody分段,可以一部分一部分地显示,不用等整个

table中thead保持不动,tbody滚动(3)

如果thead中需要合并列 #tblDataList thead {display:block;} #tblDataList tbody { display:block;height:600px; overflow-y:scroll;overflow-x: hidden;} #tblDataList thead tr { display:table; width:100%; table-layout:fixed;}#tblDataList tbody tr {display:table; wid

纯CSS,table的thead固定,tbody显示滚动条

首先是html的table的代码: 1 <table class="tablediv" id="myTable" border="1"> 2 <thead> 3 <tr> 4 <td class="wt40">111asdasdassd</td> 5 <td class="wt50">222asdsa</td> 6 <

table 表头固定 thead固定. 1) 使用jquery.freezeheader.js

方法一: 使用jquery.freezeheader.js 固定表头: 1-: 初始化: 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>表格table固定thead表头</title> 6 <style type="text/css"> 7 8 tab

table之thead兼容

今天遇到一个小bug,是关于table中thead,tbody,tfoot的兼容问题: 在开发的时候为了方便写样式,我就把表格的标题部分关于th的内容放在了thead中,当然了,我也没有写tbody和tfoot,此时,检查兼容的时候问题随之而来: 在IE,Chrome,Opera下都没问题,但是在Firefox中出现了一个问题,下面tr的内容统一向上走了一个tr,最后一个tr的内容变为空了,与thead的内容重合,我首先想到的是我没有浮动啊,什么情况.随后我检查了下元素,将thead改为tr,问

设置table中的宽度不随文字改变让其固定

设置table中的宽度不随文字改变让其固定 来源:互联网作者:佚名时间:02-17 16:02:28[大 中 小] 页面中table宽度设置width之后,宽度仍然不是固定的,文字太长后不换行,下面有个不错的方法可以有效解决这个问题 页面中table宽度设置width="600px"之后,宽度仍然不是固定的,文字太长后不换行,把table都撑变形了. 解决办法: 1.table 设置 宽度,绝对宽度和相对都可以 table-layout:fixed ; 设置了这个属性,其余所有td都是

如何让table中td宽度固定

table中td会随着里面的内容伸缩,设置其width样式并没有效果.这个时候需要下面的CSS可以实现. 首先是设置table .table {table-layout:fixed;} 其次是td .table  td { overflow: hidden; white-space: nowrap; text-overflow: ellipsis;} 如何让table中td宽度固定

将JSON数组显示前台Table中

将JSON数组显示前台Table中 在最近的学习中遇到一个小问题,如何把JSON数组显示在前台的table中,经过一番借鉴和学习之后终于解决了这个问题.具体的代码如下: (前提:利用ajax获取过来的JSON字符串必须是规范的,这样才能解析正确.后台获取数据库中数据的代码省略了) 1.前台JS代码(使用之前引入JQuery的js库文件) $.ajax({ type: "GET", url: "UserList.ashx?Action=List",//利用ajax请求