如何在SharePoint表格的1个单元格内添加按钮?

时间:2019-12-13 22:46:54

标签: sharepoint cell

我正尝试在 SharePoint 中的单元格中添加一个链接到另一个网站的按钮,但是它将按钮一直移动到表格的上方或下方,而不是移动到该单元格的内部。

是否可以使用我可以在“ 内容编辑器”下的“ 编辑源代码”中放置的嵌入代码或HTML代码来做到这一点?

在此方面的任何帮助将不胜感激。我整天都在研究解决方案。

以下是当前正在使用的内容。我在做错什么吗?

<span style="font-size: 10px;"> 
    <font face="Verdana">
        <a href="/sites/Global_OE/SitePages/Forms/ByAuthor.aspx"> 
            <strong> 
                <input name="HONDA" type="button" value="Case for Change &amp; Sponsorship                   " style="background-color: #336699; color: #ffffff;"/>
            </strong>
        </a>
    </font>
</span>
<table cellspacing="0" width="100%" class="ms-rteTable-default">
   <tbody>
      <tr class="ms-rteTableEvenRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px;">​<br/>​<br/></td>
         <td class="ms-rteTableOddCol-default" style="width: 20%; text-align: center;">
            <style="background-color: style="font-family: optima;">​<img src="/sites/Global_OE/homepagedraft/SiteAssets/SitePages/Test/Picture1.png" alt="Picture1.png" style="margin: 5px; width: 25px; height: 25px;"/><span class="ms-rteFontSize-4">Diagn​​ose &amp; Scope</span>​<br/></style="background-color:></td>
         <td class="ms-rteTableEvenCol-default" style="width: 20%;">
         </td>
         <td class="ms-rteTableOddCol-default" style="width: 20%;">
         </td>
         <td class="ms-rteTableEvenCol-default" style="width: 20%;">
         </td>
      </tr>
      <tr class="ms-rteTableOddRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px;">
         </td>
         <td class="ms-rteTableOddCol-default">
            <p>
               <span style="font-family: optima;">•Align to the business strategy</span></p>
            <p>
               <span style="font-family: optima;">•Align&#160;on what success looks like with leader and/ or sponsor</span></p>
         </td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableEvenRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">
            <div>​OE&#160;</div>
            <div> Getting Started &amp; Tracking Progress<br/></div>
         </td>
         <td class="ms-rteTableOddCol-default">​​​​​​​​​​<br/></td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableOddRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Change Management<sup>3 
               <br/></sup>(Complex Change)<br/></td>
         <td class="ms-rteTableOddCol-default">​<br/></td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableEvenRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Organization Design<br/></td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableOddRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px;">
            <div style="text-align: center;">​Everyday Change </div>
            <div style="text-align: center;">(Team Effectiveness)<br/></div>
         </td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableEvenRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​​Process Enablement<br/></td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
   </tbody>
</table>

1 个答案:

答案 0 :(得分:0)

以下代码供您参考。

<table cellspacing="0" width="100%" class="ms-rteTable-default">
   <tbody>
      <tr class="ms-rteTableEvenRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px;">​
            <span style="font-size: 10px;"> 
                <font face="Verdana">
                    <a href="/sites/Global_OE/SitePages/Forms/ByAuthor.aspx"> 
                        <strong> 
                            <input name="HONDA" type="button" value="Case for Change &amp; Sponsorship" onclick="window.location.href='/sites/Global_OE/SitePages/Forms/ByAuthor.aspx'" style="background-color: #336699; color: #ffffff;"/>
                        </strong>
                    </a>
                </font>
            </span>
         </td>
         <td class="ms-rteTableOddCol-default" style="width: 20%; text-align: center;">
            <style="background-color: style="font-family: optima;">​<img src="/sites/Global_OE/homepagedraft/SiteAssets/SitePages/Test/Picture1.png" alt="Picture1.png" style="margin: 5px; width: 25px; height: 25px;"/><span class="ms-rteFontSize-4">Diagn​​ose &amp; Scope</span>​<br/></style="background-color:></td>
         <td class="ms-rteTableEvenCol-default" style="width: 20%;">
         </td>
         <td class="ms-rteTableOddCol-default" style="width: 20%;">
         </td>
         <td class="ms-rteTableEvenCol-default" style="width: 20%;">
         </td>
      </tr>
      <tr class="ms-rteTableOddRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px;">
         </td>
         <td class="ms-rteTableOddCol-default">
            <p>
               <span style="font-family: optima;">•Align to the business strategy</span></p>
            <p>
               <span style="font-family: optima;">•Align&#160;on what success looks like with leader and/ or sponsor</span></p>
         </td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableEvenRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">
            <div>​OE&#160;</div>
            <div> Getting Started &amp; Tracking Progress<br/></div>
         </td>
         <td class="ms-rteTableOddCol-default">​​​​​​​​​​<br/></td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableOddRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Change Management<sup>3 
               <br/></sup>(Complex Change)<br/></td>
         <td class="ms-rteTableOddCol-default">​<br/></td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableEvenRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Organization Design<br/></td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableOddRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px;">
            <div style="text-align: center;">​Everyday Change </div>
            <div style="text-align: center;">(Team Effectiveness)<br/></div>
         </td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
      <tr class="ms-rteTableEvenRow-default">
         <td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​​Process Enablement<br/></td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
         <td class="ms-rteTableOddCol-default">​</td>
         <td class="ms-rteTableEvenCol-default">​</td>
      </tr>
   </tbody>
</table>

enter image description here